home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / music / cdplay.zip / CDPLAYE2.FRM < prev    next >
Text File  |  1994-03-30  |  11KB  |  358 lines

  1. VERSION 2.00
  2. Begin Form CDEntry 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Compact Disc Database"
  6.    ClientHeight    =   6510
  7.    ClientLeft      =   2940
  8.    ClientTop       =   2475
  9.    ClientWidth     =   6135
  10.    ClipControls    =   0   'False
  11.    Height          =   6915
  12.    Left            =   2880
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   6510
  16.    ScaleWidth      =   6135
  17.    Top             =   2130
  18.    Width           =   6255
  19.    Begin SSPanel Panel3D1 
  20.       BackColor       =   &H00C0C0C0&
  21.       BevelInner      =   1  'Inset
  22.       BevelOuter      =   1  'Inset
  23.       Font3D          =   0  'None
  24.       Height          =   6255
  25.       Left            =   120
  26.       TabIndex        =   10
  27.       Top             =   120
  28.       Width           =   5895
  29.       Begin PictureBox PicLogo 
  30.          AutoSize        =   -1  'True
  31.          BackColor       =   &H00C0C0C0&
  32.          BorderStyle     =   0  'None
  33.          Height          =   615
  34.          Left            =   1680
  35.          ScaleHeight     =   615
  36.          ScaleWidth      =   2535
  37.          TabIndex        =   11
  38.          Top             =   120
  39.          Width           =   2535
  40.          Begin Label lblLogo 
  41.             AutoSize        =   -1  'True
  42.             BackStyle       =   0  'Transparent
  43.             Caption         =   "CD Player"
  44.             FontBold        =   -1  'True
  45.             FontItalic      =   -1  'True
  46.             FontName        =   "MS Serif"
  47.             FontSize        =   24
  48.             FontStrikethru  =   0   'False
  49.             FontUnderline   =   0   'False
  50.             ForeColor       =   &H00C00000&
  51.             Height          =   525
  52.             Index           =   0
  53.             Left            =   0
  54.             TabIndex        =   12
  55.             Top             =   0
  56.             Width           =   2415
  57.          End
  58.          Begin Label lblLogo 
  59.             AutoSize        =   -1  'True
  60.             BackStyle       =   0  'Transparent
  61.             Caption         =   "CD Player"
  62.             FontBold        =   -1  'True
  63.             FontItalic      =   -1  'True
  64.             FontName        =   "MS Serif"
  65.             FontSize        =   24
  66.             FontStrikethru  =   0   'False
  67.             FontUnderline   =   0   'False
  68.             ForeColor       =   &H00FFFFFF&
  69.             Height          =   525
  70.             Index           =   1
  71.             Left            =   0
  72.             TabIndex        =   13
  73.             Top             =   30
  74.             Width           =   2415
  75.          End
  76.       End
  77.       Begin CommandButton Command1 
  78.          Cancel          =   -1  'True
  79.          Caption         =   "&Cancel"
  80.          Height          =   495
  81.          Index           =   2
  82.          Left            =   240
  83.          TabIndex        =   9
  84.          Top             =   5520
  85.          Width           =   5415
  86.       End
  87.       Begin CommandButton Command1 
  88.          Caption         =   "&Reset Tracks"
  89.          Height          =   495
  90.          Index           =   1
  91.          Left            =   240
  92.          TabIndex        =   8
  93.          Top             =   4920
  94.          Width           =   5415
  95.       End
  96.       Begin TextBox Text3 
  97.          Alignment       =   2  'Center
  98.          Height          =   375
  99.          Left            =   240
  100.          MultiLine       =   -1  'True
  101.          TabIndex        =   3
  102.          Top             =   1440
  103.          Width           =   5415
  104.       End
  105.       Begin CommandButton Command1 
  106.          Caption         =   "&Save"
  107.          Height          =   495
  108.          Index           =   0
  109.          Left            =   240
  110.          TabIndex        =   7
  111.          Top             =   4320
  112.          Width           =   5415
  113.       End
  114.       Begin TextBox Text2 
  115.          Alignment       =   2  'Center
  116.          Height          =   375
  117.          Left            =   240
  118.          MultiLine       =   -1  'True
  119.          TabIndex        =   1
  120.          Top             =   840
  121.          Width           =   5415
  122.       End
  123.       Begin TextBox Text1 
  124.          Alignment       =   2  'Center
  125.          Height          =   375
  126.          Left            =   240
  127.          MultiLine       =   -1  'True
  128.          TabIndex        =   5
  129.          TabStop         =   0   'False
  130.          Top             =   2160
  131.          Width           =   5415
  132.       End
  133.       Begin ListBox List1 
  134.          Height          =   1395
  135.          Left            =   240
  136.          TabIndex        =   6
  137.          Top             =   2640
  138.          Width           =   5415
  139.       End
  140.       Begin Label Label3 
  141.          AutoSize        =   -1  'True
  142.          BackStyle       =   0  'Transparent
  143.          Caption         =   "&Artist:"
  144.          Height          =   195
  145.          Left            =   240
  146.          TabIndex        =   2
  147.          Top             =   1200
  148.          Width           =   510
  149.       End
  150.       Begin Label Label2 
  151.          AutoSize        =   -1  'True
  152.          BackStyle       =   0  'Transparent
  153.          Caption         =   "C&D Title:"
  154.          Height          =   195
  155.          Left            =   240
  156.          TabIndex        =   0
  157.          Top             =   600
  158.          Width           =   765
  159.       End
  160.       Begin Label Label1 
  161.          AutoSize        =   -1  'True
  162.          BackStyle       =   0  'Transparent
  163.          Caption         =   "&Track Title:"
  164.          Height          =   195
  165.          Left            =   240
  166.          TabIndex        =   4
  167.          Top             =   1920
  168.          Width           =   5415
  169.       End
  170.    End
  171. End
  172. Option Explicit
  173. Dim SelIndex As Integer
  174. Dim Text1Dirty As Integer
  175. Dim List1Dirty As Integer
  176.  
  177. Sub Command1_Click (Index As Integer)
  178.     Dim Answer As Integer
  179.     Static Dirty As Integer
  180.  
  181.     Select Case Index
  182.         Case 0 ' Save
  183.             If Text1Dirty = True Then
  184.                 Answer = MsgBox("Edit In Progress, Abort?", 4, "OOPS!")
  185.                 If Answer = 6 Then
  186.                 Answer = MsgBox("Save Changes?", 4, "Save")
  187.                     If Answer = 6 Then
  188.                         Call UpdateTracks(List1, True)
  189.                         CommitChanges
  190.                         CDInfo.CDTitle = Text2
  191.                         CDInfo.CDAuthor = Text3
  192.                         Unload Me
  193.                     ElseIf Answer = 7 Then
  194.                         Unload Me
  195.                     End If
  196.                 ElseIf Answer = 7 Then
  197.                     Text1.SetFocus
  198.                     Exit Sub
  199.                 End If
  200.             Else
  201.                 Answer = MsgBox("Save Changes?", 4, "Save")
  202.                 If Answer = 6 Then
  203.                     Call UpdateTracks(List1, True)
  204.                     CDInfo.CDTitle = Text2
  205.                     CDInfo.CDAuthor = Text3
  206.                     CommitChanges
  207.                     Unload Me
  208.                 ElseIf Answer = 7 Then
  209.                     Unload Me
  210.                 End If
  211.             End If
  212.         Case 1 ' Reset Titles
  213.             Call UpdateTracks(List1, False)
  214.             Call LoadListBox(List1)
  215.             Dirty = True
  216.         Case 2 ' Cancel
  217.             If Dirty = True Then GetCDInfo
  218.             Unload Me
  219.     End Select
  220.  
  221. End Sub
  222.  
  223. Sub Form_Activate ()
  224.     Text2.SetFocus
  225. End Sub
  226.  
  227. Sub Form_Load ()
  228.     CenterForm CDEntry, False
  229.     CenterLogo Me, Panel3D1
  230.     
  231.     Text2 = CDInfo.CDTitle
  232.     Text3 = CDInfo.CDAuthor
  233.     Call LoadListBox(List1)
  234.     If CDForm.mnuOptionsItem(2).Checked Then OnTop CDForm
  235. End Sub
  236.  
  237. Sub Form_Unload (Cancel As Integer)
  238.     If CDForm.mnuOptionsItem(2).Checked Then OnTop CDForm
  239. End Sub
  240.  
  241. Sub List1_Click ()
  242.     Dim Title As String
  243.  
  244.     Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
  245.     Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
  246.     Text1 = Title
  247. End Sub
  248.  
  249. Sub List1_DblClick ()
  250.     Dim Title As String
  251.  
  252.     Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
  253.     Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
  254.     Text1 = Title
  255.     
  256.     Text1.SetFocus
  257.     Text1.SelStart = 0
  258.     Text1.SelLength = Len(Text1)
  259.     SelIndex = List1.ListIndex
  260.     List1Dirty = True
  261. End Sub
  262.  
  263. Sub List1_GotFocus ()
  264.     Dim Ans As Integer
  265.     If Text1Dirty = True Then
  266.         Ans = MsgBox("Abandon Edit?", 4, "Edit In Progress!")
  267.         If Ans = 6 Then
  268.             List1.Selected(SelIndex) = True
  269.             List1.SetFocus
  270.             Text1Dirty = False
  271.             List1Dirty = False
  272.             Exit Sub
  273.         ElseIf Ans = 7 Then
  274.             List1.Selected(SelIndex) = True
  275.             Text1.SetFocus
  276.             Text1.SelStart = 0
  277.             Text1.SelLength = (Len(Text1))
  278.             List1Dirty = True
  279.         End If
  280.     End If
  281.  
  282. End Sub
  283.  
  284. Sub List1_KeyPress (KeyAscii As Integer)
  285.     Dim Title As String
  286.  
  287.     If KeyAscii = 13 Then
  288.         If List1.Text = "" Then Exit Sub
  289.         Title = Mid$(List1.Text, (InStr(List1.Text, Chr$(9)) + 1), (Len(List1.Text) - (InStr(List1.Text, Chr$(9)))))
  290.         Title = (Left$(Title, (InStr(Title, Chr$(9)) - 1)))
  291.         Text1 = Title
  292.         Text1.SetFocus
  293.         Text1.SelStart = 0
  294.         Text1.SelLength = Len(Text1)
  295.         SelIndex = List1.ListIndex
  296.         List1Dirty = True
  297.     End If
  298. End Sub
  299.  
  300. Sub Text1_Change ()
  301.     Text1Dirty = True
  302. End Sub
  303.  
  304. Sub Text1_GotFocus ()
  305.     If List1Dirty = False Then
  306.         MsgBox "You must Select and item from the List Box" & CRLF & "Hit Enter or Select With Mouse", 0, "Please Select An Item To Edit"
  307.         List1.SetFocus
  308.         List1.Selected(SelIndex) = True
  309.     Else
  310.         Text1.SelStart = 0
  311.         Text1.SelLength = (Len(Text1))
  312.     End If
  313.     
  314. End Sub
  315.  
  316. Sub Text1_KeyPress (KeyAscii As Integer)
  317.     If KeyAscii = 13 Then
  318.         List1.RemoveItem SelIndex
  319.         List1.AddItem (SelIndex + 1) & ":" & Chr$(9) & (Left$(Text1, 30)) & Chr$(9) & CDTime(SelIndex + 1), SelIndex
  320.         Text1 = ""
  321.         List1.SetFocus
  322.         If List1.ListCount > (SelIndex + 1) Then
  323.             List1.Selected(SelIndex + 1) = True
  324.         Else
  325.             List1.Selected(SelIndex) = True
  326.         End If
  327.         KeyAscii = 0
  328.         Text1Dirty = False
  329.         List1Dirty = False
  330.     End If
  331. End Sub
  332.  
  333. Sub Text2_GotFocus ()
  334.     Text2.SelStart = 0
  335.     Text2.SelLength = Len(Text2)
  336. End Sub
  337.  
  338. Sub Text2_KeyPress (KeyAscii As Integer)
  339.     If KeyAscii = 13 Then
  340.         Text3.SetFocus
  341.         KeyAscii = 0
  342.     End If
  343. End Sub
  344.  
  345. Sub Text3_GotFocus ()
  346.     Text3.SelStart = 0
  347.     Text3.SelLength = Len(Text3)
  348. End Sub
  349.  
  350. Sub Text3_KeyPress (KeyAscii As Integer)
  351.     If KeyAscii = 13 Then
  352.         List1.SetFocus
  353.         Text1Dirty = False
  354.         KeyAscii = 0
  355.     End If
  356. End Sub
  357.  
  358.